﻿using System;
using System.ComponentModel.DataAnnotations;
using easyVal.ValidationAttributes;

namespace easyVal.Web.Demo.Entities
{
    public class Customer
    {
        [RequiredVal(ErrorMessage = "Customer ID is required.")]
        [Integer(ErrorMessage = "CustomerID must be a positive integer", CommaAllowedInClient = false, Positive = true)]
        public int CustomerID { get; set; }

        [RequiredVal(ErrorMessage = "Customer Name is required.")]
        [StringLengthVal(100, ErrorMessage = "Customer name maximum length is 250")]
        public string CustomerName { get; set; }

        [MilitaryTime(ErrorMessage = "Pickup time must be in military time format.")]
        public DateTime PreferredPickupTime { get; set; }

        [USPhone(ErrorMessage = "Must be 10 digits. Hypens or spaces are optional.")]
        public string PhoneNumber { get; set; }

        [USDollar(ErrorMessage = "Billed Amount must be a positive dollar amount.", Positive = true, DollarSignAllowedInClent = true, WholeNumber = false)]
        public decimal BilledAmount { get; set; }

    }
}
